<template>
	<view class="previewVideo">
		<u-popup mode="center" :show="data.show" @close="data.show = false">
			
			<video :autoplay="true" :src="data.httpUrl+'/app/file/viewFile?fileId='+data.fileId"></video>
		</u-popup>
	</view>
</template>

<script setup lang="ts">
	import {
		reactive, nextTick
	} from 'vue';
	const data = reactive<any>({
		show: false,
		httpUrl: getApp().globalData.baseUrl,
		fileId: ''
	})

	defineExpose({
		init: (fileId) => {
			data.fileId = fileId;
			nextTick(() => {
				data.show = true
				console.log(data.fileId, 'data.fileId')
			})
		}
	})
</script>

<style lang="scss">
	video {
		width: 100%;
	}
	:deep(.u-popup__content){
		width: 100%;
		background-color: transparent!important;
	}
</style>